Skip to main content

Error Codes and Messages

Sometimes, your API call will generate an error. The errors returned use the error codes defined by the HTTP standard request. Make sure your application can handle exceptions correctly. Here, you will find additional information about what to expect if you don’t format your request properly or if we fail to process your query. The codes currently used by AIMS are:

ErrorDescription
209Partial Success. Some patients had issues. See 'error_message' for details.
400Bad Request. More information in the 'message'.
403Authentication Error. Ensure your key is valid and used with the associated IP.
404The requested resource cannot be found.
413The query size is too large.
429Too Many Queries. Please wait and resend your query.
456Exceeded Limit. If you need to perform more queries, please contact admin@aimsmedical.ai.
500Internal Server Error.
503Service Temporarily Unavailable. Please try again later.

Examples of errors in the response

When a query involving multiple patients is performed, different processing and error-handling scenarios arise. These scenarios are described below:

1. Successful Processing with an Empty Patient (Response code 200):

This description communicates that the query as a whole was processed without errors, even though one of the patients included in the query was completely empty. The empty patient will be included in the response with an empty risk value and an empty 'error_message' field to indicate that it was processed correctly but no problems were found with its data.

200 ok
Content-Type: text/plain; charset=utf-8

[{
"idx": 0,
"risk": 0.93,
"error_message": null
}]

2. Success with Field Imputation (Response Code 209):

If one or more patients in the query have errors, such as missing fields that are not mandatory but have been automatically imputed, a 209 response code will be used. In this situation, the risk value will be provided for each patient, including those with imputed fields. The 'error_message' field will contain additional information detailing the reason behind the 209 code. This may include a list of the fields that were imputed, allowing the user to know what data was automatically completed.

209 Partial Success
Content-Type: text/plain; charset=utf-8

[{
"idx": 0,
"risk": 0.77,
"error_message": [{
"Field": "barthel_chairTransfers",
"FieldDate": "25-08-2021",
"ExtendError": "ValueError for value ChairTransfers in idx 1 (out of range)"
}]
},
{
"idx": 1,
"risk": 0.43,
"error_message": [{
"Field": "canadianScale_leg",
"FieldDate": "03-08-2022",
"ExtendError": "ValueError for value Leg in idx 1 (out of range)"
},
{
"Field": "canadianScale_total",
"FieldDate": "03-08-2022",
"ExtendError": "ValueError for value Total in idx 1 (the sum of the values '3.00' does not coincide with the sum provided)"
},
{
"Field": "weights",
"FieldDate": "01-09-2021",
"ExtendError": "ValueError for value in idx 0 (value -60.40 is smaller than 0)"
}]
}]

3. Success with Missing Mandatory Fields (Response Code 209):

In case one or more patients in the query have missing mandatory fields that cannot be automatically imputed, the response will also have a response code 209. However, in this case, the risk value will not be provided for those patients. The 'error_message' field shall contain detailed information on the missing mandatory fields for the affected patients.

209 Partial Success
Content-Type: text/plain; charset=utf-8

[{
"idx": 0,
"risk": null,
"error_message": [{
"Field": "mna_total",
"FieldDate": "11-07-2022",
"ExtendError": "ValueError for value Total in idx 0 (the sum of the values '7.00' does not coincide with the sum provided)"
},
{
"Field": "age",
"FieldDate": "",
"ExtendError": "ValueMissing for value age"
}]
}]
info

If an error occurs, you can find additional information about the error in the JSON included in the response under the 'error_message' parameter.